import Vue from 'vue'
// import Vue from 'vue/dist/vue.esm.js'

import App from './App'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/static/awesome/css/font-awesome.min.css';
import myObject from '@/static/js/jscommon'
import uView from '@/uni_modules/uview-ui'
import {jump} from '@/workspaces/utils/index.js'
import api from '@/workspaces/utils/apis.js'
import request from '@/workspaces/utils/request.js'
import commonApi from '@/workspaces/utils/common.js'
import $api from '@/workspaces/api/framework/api.js';
import md5 from 'js-md5' 

import './workspaces/commons/oa/common.css'
import lyRequest from './workspaces/api/framework/request.js'
Vue.prototype.$lyRequest = lyRequest
import oaconfig from './workspaces/commons/oa/config.js'
Vue.prototype.$oaconfig = oaconfig
import oacommon from './workspaces/commons/oa/common.js'
Vue.prototype.$oacommon = oacommon

Vue.prototype.$md5 = md5;
Vue.prototype.commonApi = commonApi;
Vue.prototype.$jump = jump
Vue.prototype.$req = request
Vue.prototype.$apis = api.apis
Vue.prototype.$api = $api
Vue.use(uView)
Vue.use(ElementUI)


//在main.js中注册全局组件
import CellChild from '@/workspaces/tools/cellchild.vue'
import Expandlist from '@/workspaces/tools/Expandlist.vue'

Vue.component('CellChild', CellChild)
Vue.component('Expandlist', Expandlist)

Vue.directive('money', {
  // 千分号指令
  bind(el,binding){
	  el.innerHTML = commonApi.formatAmt(el.innerHTML)
  },
  Update(el,binding){
	  el.innerHTML = commonApi.formatAmt(el.innerHTML)
  },
})

// import Treeselect from '@riophae/vue-treeselect'
// import '@riophae/vue-treeselect/dist/vue-treeselect.css'
// Vue.component('treeselect', Treeselect);

// ==============引入扩展Vue源生方式编写的组件 =================
// import f2bpmuiAutocompleter from '@/pages/components/common/f2bpmui-autocompleter.vue'
// import f2bpmuiDatetime from '@/pages/components/common/f2bpmui-datetime.vue'
// import f2bpmuiSelect from '@/pages/components/common/f2bpmui-select.vue'
// import f2bpmuiTextbox from '@/pages/components/common/f2bpmui-textbox.vue'
// Vue.component('f2bpmui-autocompleter', f2bpmuiAutocompleter);
// Vue.component('f2bpmui-datetime', f2bpmuiDatetime);
// Vue.component('f2bpmui-select', f2bpmuiSelect);
// Vue.component('f2bpmui-textbox', f2bpmuiTextbox);


// ==============引入自定义vue组件控件 ======================
import f2bpmuiUploadavatar from '@/pages/components/f2bpmui/f2bpmui-uploadavatar'
Vue.component('f2bpmui-uploadavatar', f2bpmuiUploadavatar)
import f2bpmuiAutocompleter from '@/pages/components/f2bpmui/f2bpmui-autocompleter'
Vue.component('f2bpmui-autocompleter', f2bpmuiAutocompleter)
import f2bpmuiFile from '@/pages/components/f2bpmui/f2bpmui-file'
Vue.component('f2bpmui-file', f2bpmuiFile)
import f2bpmuiRicheditor from '@/pages/components/f2bpmui/f2bpmui-richeditor'
Vue.component('f2bpmui-richeditor', f2bpmuiRicheditor)
import f2bpmuiDatetime from '@/pages/components/f2bpmui/f2bpmui-datetime'
Vue.component('f2bpmui-datetime', f2bpmuiDatetime)
import f2bpmuiTextbox from '@/pages/components/f2bpmui/f2bpmui-textbox'
Vue.component('f2bpmui-textbox', f2bpmuiTextbox)
import f2bpmuiPicture from '@/pages/components/f2bpmui/f2bpmui-picture'
Vue.component('f2bpmui-picture', f2bpmuiPicture)
import f2bpmuiSelect from '@/pages/components/f2bpmui/f2bpmui-select'
Vue.component('f2bpmui-select', f2bpmuiSelect)
import f2bpmuiCheckbox from '@/pages/components/f2bpmui/f2bpmui-checkbox'
Vue.component('f2bpmui-checkbox', f2bpmuiCheckbox)
import f2bpmuiRadio from '@/pages/components/f2bpmui/f2bpmui-radio'
Vue.component('f2bpmui-radio', f2bpmuiRadio)
import f2bpmuiStamp from '@/pages/components/f2bpmui/f2bpmui-stamp'
Vue.component('f2bpmui-stamp', f2bpmuiStamp)
import f2bpmuiCascselect from '@/pages/components/f2bpmui/f2bpmui-cascselect'
Vue.component('f2bpmui-cascselect', f2bpmuiCascselect)
import f2bpmuiDroptree from '@/pages/components/f2bpmui/f2bpmui-droptree'
Vue.component('f2bpmui-droptree', f2bpmuiDroptree)
import f2bpmuiSerialnum from '@/pages/components/f2bpmui/f2bpmui-serialnum'
Vue.component('f2bpmui-serialnum', f2bpmuiSerialnum)
// ==============引入自定义vue组件控件 结束 ======================

 
import f2bpmOnlineformitem from '@/pages/components/onlineForm/f2bpm-onlineformitem'
Vue.component('f2bpm-onlineformitem', f2bpmOnlineformitem);

import f2bpmDatagrid from "@/pages/components/f2bpmui-datagrid.vue";
Vue.component('f2bpm-datagrid', f2bpmDatagrid);
import f2bpmGridsearchform from "@/pages/components/f2bpmui.datagrid.gridSearchForm.vue";
Vue.component('f2bpm-gridsearchform', f2bpmGridsearchform);


//后端API服务地址
myObject.serverUrl = __serverpath
Vue.config.productionTip = false
Vue.prototype.$store = store
App.mpType = 'app'
//接口地址前缀  
Vue.prototype.serverUrl = myObject.serverUrl
//Vue.prototype.
const app = new Vue({
	store,
	render: h => h(App)
	// ...App
})
app.$mount()
